#ifndef _TOKEN_H_
#define _TOKEN_H_

#include "JavaCC.h"
#include "Object.h"
#include "SpecialStr.h"

class MemoryPool;
class Token;
typedef QSharedPointer<Token> TokenPtr;

class Token: public Object
{
public:
    Token();
    virtual ~Token();
    virtual QString toString();
    static Token* newToken(int ofKind);
    static Token* newToken(int ofKind, const OString & image);
    SpecialStrPtr asSpecialStr();
    //void operator delete(void *);
    //void *operator new(size_t size);
public:
    int kind;
    int beginLine;
    int beginColumn;
    int endLine;
    int endColumn;
    OString image;
    TokenPtr next;
    QWeakPointer<Token> specialToken;
    static MemoryPool *__pool;
};


#endif
